from netmiko import ConnectHandler

# 通过netmiko进行连接

devi = {
    'username': 'python',
    'passwd': '12345',
    'device_type': 'cisco_ios'
}

con = ConnectHandler(**devi)
cmd = 'pwd'
print(con.find_prompt())
output = con.send_command(cmd)
print(output)

# 关闭连接
con.disconnect()